package com.yanlin;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class GuiceBootStrap {


    public static void startup(GuiceInitConfig config) throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
        GuiceRuntimeContext.run(
                () -> {
            Class<?> clazz = GuiceRuntimeContext.loaderClass("com.yanlin.GuiceBootStrapManager");
            Method init = clazz.getDeclaredMethod("init", new Class<?>[]{GuiceInitConfig.class});
            return init.invoke(null, new Object[]{config});
        });
    }
}
